cmake_minimum_required(VERSION 3.8)
project(ee_goal_control)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
###############自编
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(moveit_ros_planning_interface REQUIRED)
find_package(moveit_ros_planning REQUIRED)
find_package(moveit_ros_robot_interaction REQUIRED)
find_package(moveit_core REQUIRED)
find_package(pluginlib REQUIRED)




if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  # the following line skips the linter which checks for copyrights
  # comment the line when a copyright and license is added to all source files
  set(ament_cmake_copyright_FOUND TRUE)
  # the following line skips cpplint (only works in a git repo)
  # comment the line when this package is in a git repo and when
  # a copyright and license is added to all source files
  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()



##寻找可执行文件
add_executable(ee_goal_node src/ee_goal_control.cpp) #这个是添加可执行文件（节点 src/.cpp文件）
add_executable(test_pose_node src/test_goal.cpp)
add_executable(goal_pose_node src/send_goal_pose.cpp)
add_executable(test1_pose_node src/test1_goal_pose.cpp)
#添加依赖
ament_target_dependencies(ee_goal_node #添加依赖，这个node依赖了rclpp头文件
  rclcpp
  std_msgs
  geometry_msgs
  moveit_ros_planning_interface
  moveit_ros_planning
  moveit_core
  pluginlib
  sensor_msgs
)
ament_target_dependencies(test_pose_node #添加依赖，这个node依赖了rclpp头文件
  rclcpp
  std_msgs
  geometry_msgs
  moveit_ros_planning_interface
  moveit_ros_planning
  moveit_core
  pluginlib
  sensor_msgs
)
ament_target_dependencies(goal_pose_node #添加依赖，这个node依赖了rclpp头文件
  rclcpp
  std_msgs
  geometry_msgs
  moveit_ros_planning_interface
  moveit_ros_planning
  moveit_core
  pluginlib
  sensor_msgs
)
ament_target_dependencies(test1_pose_node #添加依赖，这个node依赖了rclpp头文件
  rclcpp
  std_msgs
  geometry_msgs
  moveit_ros_planning_interface
  moveit_ros_planning
  moveit_core
  pluginlib
  sensor_msgs
)


#把写好的代码可以被colcon 编译
install(
  TARGETS
  ee_goal_node #节点名字
  test_pose_node
  goal_pose_node
  test1_pose_node
  DESTINATION lib/${PROJECT_NAME} #工程名字
)


ament_package()
